﻿using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Text;

namespace TestApp.Boo
{


    class EqualityComparer : IEqualityComparer
    {
        public CaseInsensitiveComparer myComparer;

        public EqualityComparer()
        {
            myComparer = CaseInsensitiveComparer.DefaultInvariant;
        }

        public EqualityComparer(CultureInfo myCulture)
        {
            myComparer = new CaseInsensitiveComparer(myCulture);
        }

        public new bool Equals(object x, object y)
        {
            if (myComparer.Compare(x, y) == 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public int GetHashCode(object obj)
        {
            return obj.ToString().ToLower().GetHashCode();
        }
    }

}
